package com.hgkj.cloud.base.enums;

import lombok.Getter;

/**
 * Description:
 * <p></p>
 *
 * @Author Created by wujj
 * @Date 2023/9/18 09:36
 */
@Getter
public enum OptionEnum {

    UPPER_OPTION_ONE("1","没有",0,true),
    UPPER_OPTION_TWO("2","有几天",1,true),
    UPPER_OPTION_THREE("3","有几天",2,true),
    UPPER_OPTION_FOUR("4","一半以上时间",3,true),

    UNDER_OPTION_ONE("1","符合",1,false),
    UNDER_OPTION_TWO("2","有点符合",2,false),
    UNDER_OPTION_THREE("3","一般",3,false),
    UNDER_OPTION_FOUR("4","有点不符合",4,false),
    UNDER_OPTION_FIVE("5","很不符合",5,false),
    ;


    private final String code;

    private final String name;

    private final Integer score;

    private final Boolean isUpper;

    OptionEnum(String code, String name, Integer score, Boolean isUpper) {
        this.code = code;
        this.name = name;
        this.score = score;
        this.isUpper = isUpper;
    }

    public static Integer toEnum(String code,Boolean isUpper) {
        for (OptionEnum optionEnum : OptionEnum.values()) {
            if (optionEnum.getCode().equals(code) && optionEnum.getIsUpper().equals(isUpper)) {
                return optionEnum.getScore();
            }
        }
        return 0;
    }




}
